package com.mmgc.shop.plugin

import com.mmgc.shop.activity.mainActivity
import io.flutter.plugin.common.MethodChannel

fun AppPlugin.doApp(method: String, arguments: Map<*, *>, result: MethodChannel.Result): Boolean {
    return when (method) {
        "goHome" -> {
            mainActivity.moveTaskToBack(true)
            true
        }

        "getSchemeData" -> {
            val data = mainActivity.intent?.extras?.getString("schemeData")
            mainActivity.intent?.extras?.remove("schemeData")
            result.success(
                mapOf(
                    "data" to data,
                )
            )
            true
        }

        else -> false
    }
}